
package examenhabitantes;


public class ordenar {
     public int[] burbuja(int[] vector) {
        int auxiliar = 0;
        for (int i = 0; i < vector.length - 1; i++) {
            for (int j = 0; j < vector.length - i - 1; j++) {
                
                    if (vector[j + 1] < vector[j]) {
                        auxiliar = vector[j + 1];
                        vector[j + 1] = vector[j];
                        vector[j] = auxiliar;
                    }
                 }
        }
        return vector;
    }
}
